<template>
	<view class="com achlist-com">
		<view class="list-top">
			<view class="list-left">
				<image class="list-img" :src="listInfo.coverPicture" mode="aspectFit"></image>
			</view>
			<view class="list-right">
				<view class="list-title no-warp">{{listInfo.achievementName}}</view>
				<view class="list-info">
					{{listInfo.achievementCategory}}
				</view>
				<view class="list-info">
					<view v-if="listInfo.belongToTechnologyCategory">
						<template v-for="(item,idx) in listInfo.belongToTechnologyCategory">
							<text class="label-type" v-if="idx<2">{{item}}</text>
						</template>
					</view>
				</view>
				<view class="list-info-bottom no-warp">
				{{listInfo.achievementDescription}}
				</view>
			</view>
		</view>
		<view class="list-bottom">
			<text class="c-primary list-status">{{getTypeWords(listInfo.state || 0)}} </text>
			
			<view class="flex-grow"></view>
			<image class="list-userimg" v-if="listInfo.issuerHeadPortrait" :src="listInfo.issuerHeadPortrait" mode="aspectFit"></image>
			<image class="list-userimg" v-else="listInfo.headPortrait" :src="listInfo.headPortrait" mode="aspectFit"></image>
			<text class="list-user">{{listInfo.issuer}}</text>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { onMounted, ref } from 'vue';
	const props = defineProps({
		listInfo: { type: Object, default: {} },
	})
	const getTypeWords = (state) => {
		const demandType = {
			0: '资料审核',
			1: '审核失败',
			2: '征集中',
		}
		return demandType[state];
	}
</script>

<style lang="scss">
	.achlist-com {
		background-color: #fff;
		padding: 20rpx;
		border-radius: 8rpx;
		margin-bottom: 20rpx;
		box-shadow: 0px 8rpx 16rpx 0px rgba(47,101,243,0.1);
		.list-top{
			display: flex;
			border-bottom: solid 1px #eee;
			padding-bottom: 20rpx;
		}
		.list-left{
			width: 220rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-shrink: 0;
			margin-right: 20rpx;
		}
		.list-img{
			width: 100%;
			height: 100%;
		}
		.list-bottom{
			padding-top: 18rpx;
			display: flex;
			align-items: center;
			font-size: 24rpx;
		}
		.list-money{
			font-weight: bold;
			font-size: 26rpx;
			color: #F97316;
			flex-grow: 1;
			text-align: right;
		}
		
		.list-right{
			color: #333;
			width: 400rpx;
			flex-grow: 1;
		}
		.list-title{
			font-size: 26rpx;
		}
		.list-info{
			font-size: 24rpx;
			margin-top: 10rpx;
		}
		.list-info-bottom{
			font-size: 24rpx;
			margin-top: 20rpx;
		}
		.list-status{
			margin-right: 15rpx;
		}
		.list-userimg{
			width: 40rpx;
			height: 40rpx;
			border-radius: 40rpx;
			margin-right: 10rpx;
			border: solid 1px #eee;
		}
	}
</style>